﻿using SIR.Common;

namespace SIR.DAL
{
	/// <summary>
	/// Data Server result from the modification of an object (INSERT, UPDATE, DELETE)
	/// </summary>
	/// <typeparam name="T">The type of object that was modified</typeparam>
	public class DataServerResult<T> where T : IEntity
	{
		/// <summary>
		/// Gets whether or not the results were successfully obtained
		/// </summary>
		public bool WasSuccessful { get; internal set; }
		/// <summary>
		/// Gets the error message that occured during the execution
		/// </summary>
		public string ErrorMessage { get; internal set; }
		/// <summary>
		/// Gets the orignial value of the object, null if the object was new
		/// </summary>
		public T OldValue { get; internal set; }
		/// <summary>
		/// Gets the resulting object of the operation, null if the object was deleted
		/// </summary>
		public T NewValue { get; internal set; }
	}
}
